package com.xbongbong.paas.config.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.workflow.enums.WorkflowNodeTypeEnum;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @author 吴峰
 * @date 2021/05/17 15:14
 */
@Getter
public enum  WorkflowActionEnum {

    /**
     * 动作
     */

    // 数据处理
    DATA_PROCESSING(1, Arrays.asList(WorkflowNodeTypeEnum.CREATE_NODE, WorkflowNodeTypeEnum.UPDATE_NODE, WorkflowNodeTypeEnum.MULTI_DATA_NODE, WorkflowNodeTypeEnum.SINGLE_DATA_NODE, WorkflowNodeTypeEnum.DELETE_NODE),
            "enum.workflowAction.desc.data_processing"),

    // 人工节点
    ARTIFICIAL_NODE(2, Arrays.asList(WorkflowNodeTypeEnum.APPROVE_NODE, WorkflowNodeTypeEnum.CC_NODE, WorkflowNodeTypeEnum.SEND_MESSAGE_NODE),
            "enum.workflowAction.desc.artificial_node"),

    // 构件
    MEMBER(3, Arrays.asList(WorkflowNodeTypeEnum.CONDITION_NODE),
            "enum.workflowAction.desc.member"),
    ;

    private Integer type;

    private List<WorkflowNodeTypeEnum> nodeList;

    private String desc;



    WorkflowActionEnum(Integer type, List<WorkflowNodeTypeEnum> nodeList, String desc) {
        this.type = type;
        this.nodeList = nodeList;
        this.desc = desc;
    }

    public String getDesc() {
        return I18nMessageUtil.getMessage(this.desc);
    }
}
